#include <iostream>

using std::cout;
using std::endl;

template <class T>
class ManyFriend
{
private:
    T item;

public:
    ManyFriend(const T &i) : item(i) {   }
    template<class C,class D>
    friend void show2( C&c,D&d);
};

template <class C,class D>
void show2(C&c, D&d)
{
    cout << c.item<<", " << d.item << endl;
}

int main(int argc, char const *argv[])
{
    ManyFriend<int> mi1(100);
    ManyFriend<int> mi2(45);
    ManyFriend<double> md1(5.2);
    ManyFriend<double> md2(45.2);
    cout<<"[mian]-No objects declared:\n";

    show2(mi1,mi2);
    show2(md1,md2);
    show2(mi2,md2);
    show2(md1,mi2);
    
    return 0;
}
